It is desired to conduct a precise measurement of a temperature with a portable electronic device such as a mobile phone or a portable computing device, which portable electronic device typically comprises a processor and/or a display generating heat during operation. The temperature of interest may be, for example, an internal temperature of the device at a given location, or may be a temperature ambient to the portable electronic device to be measured by the portable electronic device.